﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MarchEstate.Manager.BusinesEntity.Costcalculate;

namespace MarchEstate.Manager.ObjectModel.Costcalculate
{
    /// <summary>
    /// 水费阶梯收费
    /// </summary>
    public class WaterRateLadderMeter:AbstractMeterAlgorithmic
    {
        private decimal scale1;//比例

        public decimal Scale1
        {
            get { return scale1; }
            set { scale1 = value; }
        }
        private decimal scale2;

        public decimal Scale2
        {
            get { return scale2; }
            set { scale2 = value; }
        }
        private decimal scale3;

        public decimal Scale3
        {
            get { return scale3; }
            set { scale3 = value; }
        }

        private decimal degree1;//阶梯值为0

        public decimal Degree1
        {
            get { return degree1; }
            set { degree1 = value; }
        }
        private decimal degree2;

        public decimal Degree2
        {
            get { return degree2; }
            set { degree2 = value; }
        }
        private decimal degree3;

        public decimal Degree3
        {
            get { return degree3; }
            set { degree3 = value; }
        }

        public override decimal GetItemFee()
        {
            decimal result = Currentdegree - Lastdegree;
            if (result >= Degree1 && result <= Degree2)
            {
                return result * Unitprice * Scale1;
            }
            else if (result > Degree2 && result <= Degree3)
            {
                return result * Unitprice * Scale2;
            }
            else if (result > Degree3)
            {
                return result * Unitprice * Scale3;
            }
            return 0;
        }

        public override decimal GetLateFee()
        {
            return 0;
        }
    }
}
